#pragma once

#include "../Control/ControlInclude.h"
#include "UtilInclude.h" 

class GUI_API CFileEnumThread :	public CThread
{
public:
	CFileEnumThread(void);
	CFileEnumThread(wstring strPath,HWND hDestWnd,CListBoxEx *pListBox,vector<wstring>*	 pVeFilter);
	virtual ~CFileEnumThread(void);

public:
	void SetPath(wstring strPath);
	void SetDestWindow(HWND hWnd);
	void SetListBox(CListBoxEx* pListBox);
	void SetThreadNum(DWORD dwThreadNum);
	void SetFilter(vector<wstring> *pVeFilter);

public:
	void Stop();

protected:
	virtual void Run();
	void		 DoEnum(wstring strPath);

private:
	list<wstring>		m_lstPath;
	CThreadPool			m_fileEnumPool;
	vector<wstring>*	m_pVeFilter;

	wstring			m_strPath;
	HWND			m_hDestWnd;
	HANDLE			m_hEvent;
	CListBoxEx*		m_pFileList;
	DWORD			m_dwThreadNum;
	bool			m_bStop;
};
